import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';


// 获取头像的统一方法
Widget gmAvatar(String url, {
  double width = 30,
  double height,
  BoxFit fit,
  BorderRadius borderRadius
}) {
  var place = Image.asset("gsy_cat.png", width: width, height: height,);

  return ClipRRect(
    borderRadius: borderRadius ?? BorderRadius.circular(2),
    child: CachedNetworkImage(
      imageUrl: url,
      height: height,
      width: width,
      fit: fit,
//      placeholder: (context, url)=> place,
//      errorWidget: (context, url, error)=> place,
    ),
  );
}